﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Discussions.master" AutoEventWireup="false" CodeFile="SearchDiscussionContent.aspx.vb" Inherits="SearchDiscussionContent" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<fieldset>
<legend>Search Discusson Content</legend>
<ul>
<li><asp:Label ID="lblSearch" runat="server" Text="Enter Text"></asp:Label></li>
<li><asp:TextBox ID="txtSearch" runat="server"></asp:TextBox></li>
<li>
    <asp:Button ID="btnSearch" runat="server" Text="Search" /></li>
</ul>
</fieldset>
<fieldset>
<legend>Search Results</legend>
    <asp:ScriptManager ID="SManSearch" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress runat="server" ID="UProSearch" DisplayAfter="1000">
    <ProgressTemplate>
        <img src="../pix/loading.gif"  alt="Please Wait"/>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UPSearch" runat="server">
   <Triggers>
   <asp:AsyncPostBackTrigger ControlID="btnSearch" />
   </Triggers>
  <ContentTemplate>
    <asp:GridView ID="DGSearchDiscussion" runat="server" AutoGenerateColumns="False" 
          DataSourceID="DSDiscussions">
        <Columns>
            <asp:BoundField DataField="Topic" HeaderText="Topic" SortExpression="Topic" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="SearchDetails.aspx?ID={0}" HeaderText="Results" 
                Text="View Details" />
        </Columns>
    </asp:GridView>
      <asp:SqlDataSource ID="DSDiscussions" runat="server" 
          ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
          ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
          
          SelectCommand="SELECT [Topic], [Category], [ID] FROM [QDiscussionsDetails] WHERE ([Contribution] LIKE '%' + ? + '%')">
          <SelectParameters>
              <asp:ControlParameter ControlID="txtSearch" Name="Contribution" 
                  PropertyName="Text" Type="String" />
          </SelectParameters>
      </asp:SqlDataSource>
    </ContentTemplate>
    </asp:UpdatePanel>
    
</fieldset>
</asp:Content>

